<%@ page contentType="text/html;charset=UTF-8" %>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<%@ include file="/common/import.jsp" %>
<script>
var packtype ='sw';
var packid = "";
var sellerid = '24cfb53d-0be8-47de-b708-f59452ce164b';
var status = '14';
var processInsId='utrs_pack.755278';

var firstTab = "流程图";
$(function() {
     $('#main').tabs( {
		onSelect : function() {
			var tab = $('#main').tabs('getSelected');
			zgoto(tab.panel('options').title);
		}
	});
  
});

function zgoto(){
 //alert(packid);
}
function addaTab(title){
   
  var url="";
  packid = $("#packId").val();
  if(title=="转让方") url="http://www.baidu.com?packid="+packid;
  var content = '<iframe scrolling="auto" frameborder="0"  src="' + url + '" style="width:100%;height:500px;"></iframe>';

                        $('#main').tabs('add', {
                            title: title,
                            content: content,
                            closable: false
                        });
}

var add_pro_do='/utr/pro/init-pro!save.action';
	function save(){
           addaTab("转让方");
           return;
	 $('#addForm').form('submit', {
		url : add_pro_do,
		onSubmit : function() {
			var fig=$('#addForm').form("validate");
		     var isGzw=$("input:radio[name='isGzw']:checked").val();
		     if(isGzw==null||isGzw==''||isGzw==undefined){
		    	 $.messager.alert('提示', '请选择是否国资', 'info');
		    	 fig=false;
		     }
			return fig;
		},
		success : function(data) {
			var oTxt = jQuery.parseJSON(data);
			var oFlag = oTxt.flag;
			var id = oTxt.proId;
			if (oFlag == 'true') {
				$.messager.alert('提示', '添加成功！', 'info');
				$('#addDiv').dialog('close');
				$('#list').datagrid("load");
			} else {
				$.messager.alert('提示', '添加失败！', 'error');
			}
		}
	});
  }
	


function doSubmit(packId) {
	var submitUrl = "/utr/pack/pack-submit.action?packId=33cb0a38237a46b89a6fa4709486f15e";
	if (confirm("您确定要提交审核吗?") == true) {
		//window.location.href = submitUrl;
		 $.ajax({
			type:'post',
			url:submitUrl,
			dataType:'json',
			success:function(data){
			      var flag = data.flag;
			      var msg = data.message;
			      if(flag=='true'){
			    	  alert('提交审核成功！');
			    	  window.location.reload();
			      }else{
			    	  $.messager.alert('失败', msg, 'error');
			      }
				},
				error:function(){
				 alert("请检查服务器！");
				}
			});
		
	}
}

var checkBuyerInput='/utr/pack/pack!checkBuyerInput.action';


 function addTab(title, url){
	 if ($('#main').tabs('exists', title)) {
            $.messager.confirm('确认', '确定要刷新标签页： <font color=red>' + title + '</font> 吗?', function(flag){
                  if (flag) {
                          var content = '<iframe scrolling="auto" frameborder="0"  src="' + url + '" style="width:100%;height:100%;"></iframe>';
                          var tab = $('#main').tabs('getTab', title);
                          $('#main').tabs('update', {
                                 tab: tab,
                                 options: {
                                      title: title,
                                      content: content,
                                      closable: true
                                    }
                                });
                                $('#main').tabs('select', title);
                            }
                        });
                  }else{
                	  var content = '<iframe scrolling="auto" frameborder="0"  src="' + url + '" style="width:100%;height:500px;"></iframe>';
                        $('#main').tabs('add', {
                            title: title,
                            content: content,
                            closable: true
                        });
                  }
	
}
</script>
</head>
<body class="home-template">

<!-- 正文开始 -->
<div id="main">
<div title="包基本信息">
  <form name="addForm" id="addForm" method="post" >
    <input type="hidden" name="proType" id="proType" value="sw">
    <input type="hidden" name="packId" id="packId" value="">
    <table class="datagrid-body" cellspacing=1 cellpadding="0">
      <tr>
        <th width="179"> 标的名称 <font color="red">*</font> </th>
        <td class="aleft"><input type=text id="proName" name="proName" size=50
									class="easyui-validatebox"  
									validType="length[1,100]"   missingMessage="最多可输入100字"  maxlength="100"
									invalidMessage="最多可输入100字"  title="最多可输入100字"required="true" />
          
          <!--2015-02-01 add by fdong start--> 
          <font color="red">建议格式:***项目转让或***房产出租</font> 
          <!--2015-02-01 add by fdong end--></td>
      </tr>
      <tr>
        <th> 是否国资<font color="red">*</font> </th>
        <td><input type="radio"  name="isGzw" value="T" />
          是
          <input type="radio"  name="isGzw" value="F" />
          否 </td>
      </tr>
      <tr>
        <th> 转让方名称 <font color="red">*</font> </th>
        <td><input type=text id="sellerName" name="sellerName"
										 size=50 class="easyui-validatebox" 
											validType="length[1,100]"   missingMessage="最多可输入100字"  maxlength="100"
										invalidMessage="最多可输入100字"  title="最多可输入100字" required="true" /></td>
      </tr>
    </table>
    <center>
      <br/>
      <a href="javascript:void(0)" value="提交" class="easyui-linkbutton" iconCls="icon-save" onClick="save();">提交</a>
    </center>
  </form>
</div></div>
<!-- 正文结束 -->
<%@ include file="/common/top.jsp" %>
</body>
</html>